package com.project.service;

import java.util.List;

import com.project.dao.FiletypeDao;
import com.project.entity.Filetype;
import com.project.util.DateUtil;
import com.project.util.PKUtil;

public class FiletypeService {

	FiletypeDao dao = new FiletypeDao();
	
	public List<Filetype> findByProjectid(String projectid) {
		return dao.findByProjectid(projectid);
	}
	
	public void save(String name,String userid,String projectid) {
		
		Filetype ft = new Filetype();
		
		ft.setCreatetime(DateUtil.getNow());
		ft.setId(PKUtil.getId());
		ft.setName(name);
		ft.setUserid(userid);
		ft.setProjectid(projectid);
		
		dao.save(ft);
	}
	
	public Filetype findByid(String id) {
		return dao.findByid(id);
	}
	
	public int countNum(String filetypeid) {

			return dao.countNum(filetypeid);	
	}
	
	public long countSize(String filetypeid) {
		
			return dao.countSize(filetypeid);
	}
}
